package com.huawei.fastengine.fastview.util;

import android.util.Log;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class FastSDKProfile {
    private static final String TAG = "FastProfile";
    private static Map<String, Long> recordMap = new ConcurrentHashMap();

    public static void begin(String str) {
        long currentTimeMillis = System.currentTimeMillis();
        Log.i(TAG, "[begin] [sdk] [" + str + "] " + currentTimeMillis);
        recordMap.put(str, Long.valueOf(currentTimeMillis));
    }

    public static void end(String str) {
        long currentTimeMillis = System.currentTimeMillis();
        Log.i(TAG, "[end] [sdk] [" + str + "] " + currentTimeMillis);
        Object remove = recordMap.remove(str);
        if (remove != null) {
            Log.i(TAG, "[dur] [sdk] [" + str + "] " + (currentTimeMillis - ((Long) remove).longValue()));
        }
    }

    public static void log(String str) {
        Log.i(TAG, "[log] [sdk] [" + str + "] " + System.currentTimeMillis());
    }
}
